//
//  WebVoicePlayerViewController.m
//  Utils
//
//  Created by enghou on 2018/4/19.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "WebVoicePlayerViewController.h"
@interface WebVoicePlayerViewController ()

@end

@implementation WebVoicePlayerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIWebView *web = [[UIWebView alloc]initWithFrame:CGRectMake(0, self.view.bottom - 40 - 64, self.view.width, 40)];
    web.backgroundColor = [UIColor blackColor];
    [self.view addSubview:web];
    [web setMediaPlaybackRequiresUserAction:NO];
    if ([self.url length] > 0) {
//        NSString *webContent = [NSString stringWithFormat:@"<!DOCTYPE HTML>\
//                                <html>\
//                                <body style=\"text-align:center;\">\
//                                <audio src=\"%@\" controls=\"controls\" autoplay=\"autoplay\">\
//                                Your browser does not support the audio element.\
//                                </audio>\
//                                </body>\
//                                </html>",self.url];
        NSString *webContent = [NSString stringWithFormat:@"<!DOCTYPE HTML>\
                                <html>\
                                <body>\
                                \
                                <embed src=\"http://delingha-zztest.hzsxkj.cn/uploadFile/upload/issue/amr/2018/4/18/16309489925.amr\" />\
                                \
                                </body>\
                                </html>"];
        [web loadHTMLString:webContent baseURL:nil];
    }
    // Do any additional setup after loading the view.
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self dismissViewControllerAnimated:NO completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
